package com.fly.controller;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 用户主页控制器
 * Created by Fly on 2017/8/3.
 */
@Controller
@RequestMapping("/blogs")
public class UserSpaceController {

    private Logger logger = Logger.getLogger(this.getClass());

    @GetMapping
    public String listBlogs(@RequestParam(value = "order", defaultValue = "new") String order,
                            @RequestParam(value = "keyword", required = false, defaultValue = "") String keyword) {

        logger.info("order:" + order + ";keyword:" + keyword);
        return "redirect:/index?order=" + order + "@keyword=" + keyword;
    }
}
